$(function(){
//==================二维码=============================
	$('.ma_delete').click(function(){
		$(this).parent().css({display:"none"});
	});	
	$('.ppd4').hover(function(){
		$(this).children('.ma').css({display:"inline-block"});
	},function(){
		$(this).children('.ma').css({display:"none"});
	});
//===================附加导航栏===========================
	$('.navigation_content:not(.main_nav)').hover(function(){		
		$(this).children('.down_hidden').css({display:"inline-block"});
		$(this).siblings('.navigation_content_bro').css({display:"inline-block"});
		$(this).css({background:"#0A56BB"});
		$(this).children('.tar').css({display:"inline-block"});
		$(this).parents('.navigation').siblings('.navigation_bro').children('.navigation_bro_son').css({display:"none"});
		
	},function(){
		$(this).css({background:"#2577E3"});
		$(this).children('.down_hidden').css({display:"none"});
		$(this).siblings('.navigation_content_bro').css({display:"none"});
		$(this).children('.tar').css({display:"none"});
		$(this).parents('.navigation').siblings('.navigation_bro').children('.navigation_bro_son').css({display:"inline-block"});
	});
//=============主展示区=======================================
	
	var num = 0;	
	function run(){
		$('.show').eq(num).fadeIn(500).siblings('.show').fadeOut(500);
		$('.clickList').eq(num).children().slideDown(1000);
		$('.clickList').eq(num).siblings('.clickList').children().slideUp(1000);
		num++;
		if(num == $('.show').length ){
			num = 0;
		}
	}
	run();
	var time1 = setInterval(run,4000);
	$('.main_show').hover(function(){
		clearInterval(time1);
	},function(){
		time1 = setInterval(run,4000);
	});
	
	$('.clickList').mouseenter(function(){
		num = $(this).index();
		run();
	});
//===================展示区小窗口=====================
	$('.menu_li').click(function(){
		$(this).css({"border-right":"none","border-radius":"0px"}).children('.right_body_content').css({display:"block"});
		$(this).siblings('.menu_li').css({"border-right":"1px dashed #FFFDF4","border-radius":"4px"}).children('.right_body_content').css({display:"none"});
		
	});
	var left = ($('.main_show_body').width()-$('.blackball').width());
	var top = ($('.main_show_body').height()-$('.blackball').height());
	var a = 0;
	var b = 0;
	function look(){
		if(a == 0){
			c = 0;
		}else if(a == left){
			c = 1;
		}
		if(c == 0){
			a++;	
		}else{
			a--;
		}
		if(b == 0){
			d = 0;
		}else if(b == top){
			d = 1;
		}
		if(d == 0){
			b++;	
		}else{
			b--;
		}
		$('.blackball').animate({left:a,top:b},10);
		$('.blackball_bro').animate({left:a,top:b},10);
		$
	}

	var time2 = setInterval(look,10);
	var h = Math.floor(10*Math.random());
	var w = Math.floor(10*Math.random());
	var k = 0;
	
	var left1 =[12,123,280,456,354,111,1092,619,700,900,549,232];
	var top1 =[12,123,280,11,23,310,222,111,99,20,250,1];
	$('.blackball').hover(function(){
//		alert(k);
		if(k ==0 ){
			$(this).stop().animate({left:left1[w],top:top1[h]},1000);	
			$(this).siblings('.blackball_bro').stop().animate({left:left1[w],top:top1[h]},1000);
			k++;
			h++;
			w++;
		}				
	});
	$('.blackball').click(function(){
		$(this).css({display:"none"});
		$(this).siblings('.blackball_bro').css({display:"none"});
		$(this).siblings('.search_body_bro').delay(1500).fadeTo(1000,0.3);
		$(this).siblings('.search_body').animate({opacity:1,left:"50px"},2000);
		clearInterval(time2);
	});
	$('#delete').click(function(){
		$(this).parents('.search_body').animate({opacity:0},500).css({left:"-580px"});
		$(this).parents('.search_body').siblings('.search_body_bro').fadeOut(500);
		$(this).parents('.search_body').siblings('.blackball').css({display:"block"});
		$(this).parents('.search_body').siblings('.blackball_bro').css({display:"block"});
		time2 = setInterval(look,10);
		k = 0;
		h = Math.floor(10*Math.random());
		w = Math.floor(10*Math.random());
	});
//--------------------手风琴----------------------------------
	$('.hand_li').hover(function(){

		$(this).stop().animate({width:"397px"},500);
		$(this).children('a').children('.hand_pic_bro').stop().css({display:"none"});
		$(this).children('a').children('.h2').stop().css({display:"none"});
		$(this).siblings('.hand_li').stop().animate({width:"131px"},500);
		
	}, function(){
		$(this).stop().animate({width:"169px"},500);
		$(this).siblings('.hand_li').stop().animate({width:"169px"},500);
		$(this).children('a').children('.h2').stop().css({display:"block"});
		$(this).children('a').children('.hand_pic_bro').stop().css({display:"block"});
	});
	$('.title ul li').click(function(){
		$(this).addClass('to_blue');
		$(this).siblings('li').removeClass('to_blue');
	});
	$('.small_title ul li').click(function(){
		$(this).addClass('become_blue');
		$(this).siblings('li').removeClass('become_blue');
	});
	
	
	var top1 = $('.characteristic_top .long_characteristic');
	var down = $('.characteristic_down .long_characteristic');	
	var offset = top1.width()/2 * -1;
	function runFast(){
		var first = $('.characteristic_top .long_characteristic ul').first();		
		top1.stop().animate({left:offset},8000,"linear",function(){
			$(this).append(first);
			$(this).css({left:"0px"});
			var left = top1.css("left");
			if(left == "0px"){
				runFast();
			}	
		});	
	}
	
	
	
	
	function runFast1(){	
			var first = $('.characteristic_down .long_characteristic ul').last();		
			down.stop().animate({left:"0px"},8000,"linear",function(){
			$(this).prepend(first);
			$(this).css({left:offset});
			var left = down.css("left");
			if(left == "-924px"){
				runFast1();
			}	
		});					
	}
//	var time3 = setInterval(runFast, 8000);
//	var time3 = setInterval(runFast, 8000);
	runFast();
	runFast1();




	$('.black_hotel').hover(function(){
		$(this).siblings('.black_hotel_bro').fadeTo(200,0.7);
	}, function(){
		$(this).siblings('.black_hotel_bro').fadeTo(200,0.5);
	});
	$('.taxi_travel_img_list').hover(function(){
		$(this).children('.half_hidden').stop().animate({bottom:"0px"},500);
		$(this).children('.half_hidden_bro').stop().animate({bottom:"0px"},500);
	},function(){
		$(this).children('.half_hidden').stop().animate({bottom:"-20px"},500);
		$(this).children('.half_hidden_bro').stop().animate({bottom:"-20px"},500);
	});
	$('.hotel_img_list').hover(function(){
		$(this).children('a').children('img').stop().animate({width:"230px",height:"230px"});
	}, function(){
		$(this).children('a').children('img').stop().animate({width:"220px",height:"220px"});
	});

//	var clearSelection = function () {
//		 if(document.selection && document.selection.empty) {
//			 document.selection.empty();
//		 } else if(window.getSelection) {
//			 var sel = window.getSelection();
//			 sel.removeAllRanges();
//		 }
//	 }
//	 
//	 $('.title ul li').bind('dblclick',function(event){
//		 clearSelection();
//	 });
	
});
	


